<template>
  <router-view v-slot="{ Component, route }">
    <BaseLayout v-if="route.meta?.layout !== 'auth'">
      <component :is="Component" />
    </BaseLayout>
    <component v-else :is="Component" />
  </router-view>
</template>

<script setup lang="ts">
import { onMounted } from 'vue';
import BaseLayout from '@/layouts/BaseLayout.vue';
import { useAuthStore } from '@/store/modules/auth';

const authStore = useAuthStore();

onMounted(() => {
  authStore.initialize();
});
</script>

<style scoped>
:global(body) {
  background-color: #f5f7fa;
}
</style>

